﻿//using System;
//using System.Collections;
//using System.Linq;
//using System.Text;

//using Microsoft.VisualStudio.TestTools.UnitTesting;

//using Pibby.Core.Rss;

//namespace Pibby.Core.Tests
//{
//    [TestClass]
//    public class LinkScraperTests
//    {
//        [TestMethod]
//        public void ScrapingEmptyTextNoLinksFound()
//        {
//            var links = LinkScraper.Find("");

//            //Assert.IsEmpty(links);
//        }

//        [TestMethod]
//        public void ScrapingIncompleteHrefIsRepaired()
//        {
//            StringBuilder builder = new StringBuilder();

//            builder.AppendLine("<a href=\"www.google.com\">google.com</a>");
//            var links = LinkScraper.Find(builder.ToString());

//            Assert.AreEqual(1, links.Count);
//            Assert.AreEqual("http://www.google.com/", links[0].AbsoluteUri);
//        }

//        [TestMethod]
//        public void ScrapingBrokenHrefIsNotRepaired()
//        {
//            StringBuilder builder = new StringBuilder();

//            builder.AppendLine("<a href=\"ftp:ftp.google.com\">google.com</a>");
//            var links = LinkScraper.Find(builder.ToString());

//            Assert.AreEqual(0, links.Count);
//        }

//        [TestMethod]
//        public void ScrapingValidUrlsInAnchorsAreAdded()
//        {
//            StringBuilder builder = new StringBuilder();

//            builder.AppendLine("<html><body><p>This is a link : <a href=\"http://www.google.com\">google.com</a>.</p>");
//            builder.AppendLine("<html><body><p>This is another link <a href=\"http://www.yahoo.co.uk/\" alt=\"Yahoo\'s website\">yahoo</a>.</p></body></html>");

//            var links = LinkScraper.Find(builder.ToString());

//            Assert.AreEqual(2, links.Count);
//            Assert.AreEqual("http://www.google.com/", links[0].AbsoluteUri);
//            Assert.AreEqual("http://www.yahoo.co.uk/", links[1].AbsoluteUri);
//        }

//    }
//}
